package com.iqik.change;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@MapperScan("com.iqik.change.mapper")
@SpringBootApplication
public class DataSourceChangeApplication {

	public static void main(String[] args) {
		DataSourceChangeApplication.args = args;
		configurableApplicationContext = SpringApplication.run(DataSourceChangeApplication.class, args);
	}

	private static String[] args;

	private static ConfigurableApplicationContext configurableApplicationContext;

	public static void restart() {
		configurableApplicationContext.close();
		configurableApplicationContext = SpringApplication.run(DataSourceChangeApplication.class, args);
	}

}
